package com.atguigu.yygh.hosp.hosp.controller;


import com.atguigu.yygh.common.result.R;

import com.atguigu.yygh.model.hosp.HospitalSet;
import com.atguigu.yygh.vo.hosp.HospitalSetQueryVo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 医院设置表 前端控制器
 * </p>
 *
 * @author atguigu
 * @since 2021-10-30
 */
@Api(description = "登录接口")
@RestController
@RequestMapping("/admin/hosp")
//@CrossOrigin  //跨域
public class UserLoginController {

    //http://localhost:9528/dev-api/vue-admin-template/user/login
    //
    //{"code":20000,"data":{"token":"admin-token"}}
    //登录
    @PostMapping("user/login")
    public R login() {
        return R.ok().data("token","admin-token");
    }

//    http://localhost:9528/dev-api/vue-admin-template/user/info?token=admin-token
//
//    {"code":20000,"data":{"roles":["admin"],
//        "introduction":"I am a super administrator",
//                "avatar":"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",
//                "name":"Super Admin"}}
    //info
    @GetMapping("user/info")
    public R info() {
        return R.ok().data("roles","admin")
                .data("introduction","I am a super administrator")
                .data("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif")
                .data("name","Super Admin");
    }
}

